package com.cashmama.market.api.domain.convert;

import com.cashmama.market.api.domain.vo.order.UsageOfLoan;
import com.cashmama.market.api.infras.enums.LoanPurposeEnums;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @program: market-api
 * @description
 * @author: frank
 * @create: 2019-12-24 19:45
 **/
public class EnumConvertList {

    public static List<UsageOfLoan> convert2List(){
        List<UsageOfLoan> usageOfLoans = Lists.newArrayList();
        for(LoanPurposeEnums loanPurposeEnums : LoanPurposeEnums.values()){
            UsageOfLoan usageOfLoan = new UsageOfLoan();
            usageOfLoan.setCode(loanPurposeEnums.getType());
            usageOfLoan.setDesc(loanPurposeEnums.getDesc());
            usageOfLoans.add(usageOfLoan);
        }
        return usageOfLoans;
    }
}
